#include<iostream>
#include <time.h>
using namespace std;
#define Swap(a, b) \
    {              \
        int t = a; \
        a = b;     \
        b = t;     \
    }
int num = 0;
int d[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
int Perm(int begin, int end)
{
    int i;
    if(begin == end)
    {
      num++;
    }
    else
    {
        for (i = begin; i <= end;i++)
        {
            Swap(d[begin], d[i]);
            Perm(begin + 1, end);
            Swap(d[begin], d[i]);
        }
    }
    return 0;
}

int main()
{
    clock_t start, end;
    start = clock();
    Perm(0, 11);
    end = clock();
    cout << num << endl;
    cout << (double)(end - start) / CLOCKS_PER_SEC << endl;
    return 0;
}

